<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .span {
      margin-left: 10px;
    }
  </style>
</head>
<body>
  <div id="app">
    <!-- v-for:循环显示 -->
    <!-- 循环数组 -->
    <p v-for="(item,index) in arr1" :key="index">{{index + 1}}.  {{item}}</p>
    <p>马老师闪电五连鞭价目表</p>
    <!-- key的值要唯一，数据类型是字符串或者数组 -->
    <p v-for="(kongFu, index) in kongfus" v-bind:key="index+'shandian'">
      {{index + 1}}. 招式：{{kongFu.name}}，价格：<span style="color: red">{{kongFu.price}}</span>
    </p>
    <hr>
    <!-- 循环对象 -->
    <p v-for="(val,key, index) in person">{{index+1}}.{{key}}-{{val}}</p>
    <hr>
    <!-- 循环整数 -->
    <button v-for="num in 5">第{{num}}页</button>
    <!-- 循环字符串 -->
    <p v-for="str in 'hello'">{{str}}</p>
    <hr>
    <!-- 双重循环，先写内部再写外部。先写一个，替换变量。 -->
    <p v-for="m in 9" v-if="m>2">
      <span class="span" v-for="n in m">{{n}}*{{m}}={{n*m}}</span>
    </p>
  </div>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        arr1: [1,2,3,4,5],
        kongfus: [
          {name: '接化发', price: 100},
          {name: '窝里斗', price: 150},
          {name: '没有闪', price: 200},
          {name: '大意了', price: 250},
          {name: '耗子尾汁', price: 1000}
        ],
        person: {
          name: 'Ma baoguo',
          age: 70,
          title: '浑元形意太极掌门人',
          city: 'China'
        }
      }
    })
  </script>
</body>
</html>